Jes.Info ={
	init : function(){
		var menuid = Jes.request('menuid');
		if(!menuid) return;
		this.menuDir(menuid);
		Jes.sync(function(){
			Jes.Info.left(menuid);
		});
		this.info(menuid);
	}
	,left : function(menuid){
		menuid = menuid || 0;
		/*
		Jes.queryO('TJesVcount',{param:{id:'1'},isSess:0,isLoad:false},function(da){
			var c = da.count+'',len= c.length,a='';
			for(var i=0;i<10-len;i++){a+='0';}
			Jes.html('count',a+c);
		});
		*/
		//判断是否领导之窗,稍微影响速度
		Jes.queryO('TJesFmenu',{isSess:0,isLoad:0,param:{id:menuid}},function(da){
			if(da.type=='2'){
				Jes.query('lead_query_sql@bl',{isSess:0,isLoad:0},function(_da){
					//如果没有infoid直接跳到infoshow.html
					var infoid =  Jes.request('infoid');
					if(!infoid) Jes.url('lead.html?menuid='+menuid+'&infoid='+_da[0].id);
					else{//展现领导列表
						var taEl=Jes('left_menu_list'),tr=Jes.Table.newTr(taEl),urlPa;
						Jes.Table.newTd(tr,{colSpan:'2',align:'center',height:'10px'});
						Jes.each(_da,function(i){
							tr=Jes.Table.newTr(taEl);
							tr.onmouseover=function(){this.bgColor="#eff3fa";}
							tr.onmouseout=function(){this.bgColor="#ffffff";}
							Jes.Table.newTd(tr,{width:'20%',height:'30',align:'right'},null,'<img src="../themes/default/images/flag6.jpg" hspace="15">');
							Jes.Table.newTd(tr,{align:'left'},null,'<a href="lead.html?menuid='+menuid+'&infoid='+this.id+'" class="left_font">'+this.name+'</a>');
							tr=Jes.Table.newTr(taEl);
							Jes.Table.newTd(tr,{colSpan:'2',height:'1',background:'../themes/default/images/line2.jpg'});
						});
						tr=Jes.Table.newTr(taEl);
						Jes.Table.newTd(tr,{colSpan:'2',align:'center',height:'10px'});
						Jes.html('left_menu',da.name);
					}
				});
			}else{
				//Jes
				Jes.action('listMenuNextOrCur@App',{menuid:menuid},function(da){
					var taEl=Jes('left_menu_list'),tr=Jes.Table.newTr(taEl),urlPa;
					Jes.Table.newTd(tr,{colSpan:'2',align:'center',height:'10px'});
					Jes.each(da.list,function(i){
						tr=Jes.Table.newTr(taEl);
						tr.onmouseover=function(){this.bgColor="#eff3fa";}
						tr.onmouseout=function(){this.bgColor="#ffffff";}
						Jes.Table.newTd(tr,{width:'20%',height:'30',align:'right'},null,'<img src="../themes/default/images/flag6.jpg" hspace="15">');
						urlPa = Jes.menuUrl(this);
						Jes.Table.newTd(tr,{align:'left'},null,'<a href="'+urlPa[0]+'" '+urlPa[1]+' class="left_font">'+this[1]+'</a>');
						tr=Jes.Table.newTr(taEl);
						Jes.Table.newTd(tr,{colSpan:'2',height:'1',background:'../themes/default/images/line2.jpg'});
					});
					tr=Jes.Table.newTr(taEl);
					Jes.Table.newTd(tr,{colSpan:'2',align:'center',height:'10px'});
					Jes.html('left_menu',da.menuid=='0'?'快速导航':da.menu);
				});
			}
		});
	}
	,menuDir : function(menuid){
		Jes.action('getMenuDir@App',menuid,function(da){
			Jes.html('menu_dir',da);
		});
	}
	/*
	,info : function(menuid){
		var html=[];
		Jes.queryO('TJesFmenu',{isSess:0,isLoad:false,param:{id:menuid}},function(da){
			html.push('<table border=0 cellSpacing=0 cellPadding=0 width="95%"><br><tbody>');
			html.push('<tr><td class=fontOrange height=25 colSpan=2>');
			html.push('<table border=0 cellSpacing=0 cellPadding=0 width="98%"><tbody><tr><td><img border=0 align=absMiddle src="../themes/default/images/tu.jpg">|<B>'+da.name+'</B></td></tr></tbody></table>');
			html.push('</td></tr><tr><td bgColor=#ff6911 height=2 colSpan=2></td></tr>');
			html.push('<tr><td colSpan=2 id="info_list"></td></tr><tr><td height=30 width="95%" align=right id="page_div"></td>')
			html.push('<td width="5%" align=right></td></tr></tbody></table>');
			Jes.html('menu_info',html);
			if(da.istupview=='1'){
				Jes.Info.infoUploadPage(menuid,1);
			}else{
				Jes.action('getMenuIdsByPId@App',menuid,function(da){
					Jes.Info.infoPage(da,1);
				});
			}
		});
	}
	,infoPage : function(menuids,page){
		var html =['<table border=0 cellSpacing=0 cellPadding=0 width="100%"><tbody>'];
			Jes.page('topic_query_sql@bl',{isSess:0,isLoad:0,page:page,size:15,param:{menuids:menuids}},function(data){
				da = data.list;
				Jes.each(da,function(i){
					html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
					html.push('<td><a class=font14_666666 title="'+da[i].title+'" href="'+Jes.sysUrl('infoshow',{menuid:da[i].fmenuid,infoid:da[i].id})+'" target=_blank>'+da[i].title+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
					html.push('<td align="rigth" width="100"><FONT color=gray>('+da[i].posttime.sub(10)+')</FONT></SPAN></td></tr><tr background="../themes/default/images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
				});
				html.push('</tbody></table>');
				Jes.html('info_list',html);
				var _pageH = Jes.pageH(data,'Jes.Info.infoPage('+menuids+',page);');
				Jes.html('page_div',_pageH);
			});
	}
	,infoUploadPage : function(menuid,page){
		var html =['<table border=0 cellSpacing=0 cellPadding=0 width="100%"><tbody>'];
		Jes.page('upload_menuid_query_sql@bl',{isSess:0,isLoad:0,page:page,size:15,param:{menuid:menuid}},function(data){
			da = data.list;
			Jes.each(da,function(i){
				html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
				html.push('<td><a class=font14_666666 title="'+this.oldname+'" href="../../download.shtml?name='+this.name+'&oldName='+this.oldname+'&dir='+this.dir+'">'+da[i].oldname+'</a>&nbsp;');//<FONT color=#ff9900>(图)</FONT>
				html.push('<FONT color=gray>('+this.uptime+')</FONT></SPAN></td></tr><tr background="../themes/default/images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
			});
			html.push('</tbody></table>');
			Jes.html('info_list',html);
			var _pageH = Jes.pageH(data,'Jes.Info.infoUploadPage(\''+menuid+'\',page);');
			Jes.html('page_div',_pageH);
		});
	}
	*/
	,info : function(menuid){
		var html =[],urlPa,url;
		Jes.sync(function(){
			Jes.action('listMenuDeep@App',{menuid:menuid},function(da){
				if(!Jes.isNull(da)){//
					Jes.each(da,function(i){//显示栏目
						if(this[4]!='1'){
							html.push('<table border=0 cellSpacing=0 cellPadding=0 width="95%"><br><tbody>');
							html.push('<tr><td class=fontOrange height=25 colSpan=2>');
							urlPa = Jes.menuUrl(this);
							url=urlPa[1]!=''?'info.html?menuid='+this[0]:urlPa[0];
							html.push('<table border=0 cellSpacing=0 cellPadding=0 width="98%"><tbody><tr><td><img border=0 align=absMiddle src="../themes/default/images/tu.jpg">| <B><a href="'+url+'">'+da[i][1]+'</a></B></td></tr></tbody></table>');
							html.push('</td></tr>');
							html.push('<tr><td bgColor=#ff6911 height=2 colSpan=2></td></tr>');
							html.push('<tr><td colSpan=2><table border=0 cellSpacing=0 cellPadding=0 width="100%"><tbody>');
							html = Jes.Info.menuOrList(da[i][0],da[i][6],html);
							//html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
							//html.push('<td><a class=font14_666666 title=法律法规测试-局领导赴各现场工作点进行高温慰问 href="http://www.nbjxnet.com/blciq/info_show.asp?sysid=6&amp;newstype_id=15" target=_blank>法律法规测试-局领导赴各现场工作点进行高温慰问</a>&nbsp;<FONT color=#ff9900>(图)</FONT>');
							//html.push('<FONT color=gray>(2011-7-8)</FONT></SPAN></td></tr><tr background="images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
							html.push('<td width="5%" align=right><SPAN class=texttitle><a href="'+url+'"><img border=0 src="../themes/default/images/more.gif"></a></SPAN>');
							html.push('</td></tr></tbody></table>');
							return false;
						}
						//if(i>0) return;
					});
					Jes.html('menu_info',html);
				}else{//当前
					Jes.queryO('TJesFmenu',{isSess:0,isLoad:0,param:{id:menuid}},function(da){
						html.push('<table border=0 cellSpacing=0 cellPadding=0 width="95%"><br><tbody>');
						html.push('<tr><td class=fontOrange height=25 colSpan=2>');
						html.push('<table border=0 cellSpacing=0 cellPadding=0 width="98%"><tbody><tr><td><img border=0 align=absMiddle src="../themes/default/images/tu.jpg">| <B>'+da.name+'</B></td></tr></tbody></table>');
						html.push('</td></tr><tr><td bgColor=#ff6911 height=2 colSpan=2></td></tr>');
						html.push('<tr><td colSpan=2 id="info_list"></td></tr><tr><td height=30 width="95%" align=right id="page_div"></td>')
						html.push('<td width="5%" align=right></td></tr></tbody></table>');
						Jes.html('menu_info',html);
						if(da.istupview=='1'){
							Jes.Info.infoUploadPage(menuid,1);
						}else{
							Jes.Info.infoPage(menuid,da.type,1);
						}
					});
				}
			});
		});
	}
	//如果有子级menu显示menu，如果没有就显示infoList
	,menuOrList : function(menuid,type,html){
		var urlPa;
		Jes.action('listMenuDeep@App',{menuid:menuid},function(da){
			if(!Jes.isNull(da)){
				Jes.each(da,function(i){
					html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
					urlPa = Jes.menuUrl(this);
					html.push('<td><a class=font14_666666 title="'+this[1]+'" href="'+urlPa[0]+'" '+urlPa[1]+'>'+this[1]+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
					html.push('<td align="right" width="100"><FONT color=gray></FONT></SPAN></td></tr><tr background="images/line2.jpg"><td height=1 background="" colSpan=3></td></tr>');
				});
				html.push('</tbody></table></td></tr><tr><td height=30 width="95%" align=right><SPAN class=texttitle>共&nbsp;'+da.length+'&nbsp;个子栏目 &nbsp;&nbsp;</SPAN></td>')
			}else{
				html =Jes.Info.infoList(menuid,type,html);
			}
		});
		return html;
	}
	,infoList : function(menuid,type,html){
		if(type=='1'){
			//Jes.action('getMenuIdsByPId@App',menuid,function(da){
				Jes.page('topic_query_sql@bl',{isSess:0,isLoad:0,size:5,param:{menuid:menuid}},function(data){
					da = data.list;
					Jes.each(da,function(i){
						html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
						html.push('<td><a class=font14_666666 title="'+da[i].title+'" href="'+Jes.sysUrl('infoshow',{menuid:da[i].fmenuid,infoid:da[i].id})+'" target=_blank>'+da[i].title.sub(60,1)+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
						html.push('<td align="right" width="100"><FONT color=gray>('+da[i].posttime.sub(10)+')</FONT></SPAN></td></tr><tr background="images/line2.jpg"><td height=1 background="" colSpan=3></td></tr>');
					});
					html.push('</tbody></table></td></tr><tr><td height=30 width="95%" align=right><SPAN class=texttitle>共检索到&nbsp;'+data.aN+'&nbsp;条信息 &nbsp;&nbsp;</SPAN></td>');
				});
			//});
		}else if(type=='2'){
			/* 已经直接跳转到infoshow.html了
			Jes.page('lead_query_sql@bl',{isSess:0,isLoad:0,size:5},function(data){
				da = data.list;
				Jes.each(da,function(i){
					html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
					html.push('<td><a class=font14_666666 title="'+da[i].name+'" href="'+Jes.sysUrl('lead',{menuid:menuid,infoid:da[i].id})+'" target=_blank>'+da[i].name.sub(60,1)+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
					html.push('<td align="right" width="100"><FONT color=gray>('+da[i].posttime.sub(10)+')</FONT></SPAN></td></tr><tr background="images/line2.jpg"><td height=1 background="" colSpan=3></td></tr>');
				});
				html.push('</tbody></table></td></tr><tr><td height=30 width="95%" align=right><SPAN class=texttitle>共检索到&nbsp;'+data.aN+'&nbsp;条信息 &nbsp;&nbsp;</SPAN></td>')
			});
			*/
		}
		return html;
	}
	,infoPage : function(menuid,type,page){
		var html =['<table border=0 cellSpacing=0 cellPadding=0 width="100%"><tbody>'];
		if(type=='1'){
			Jes.page('topic_query_sql@bl',{isSess:0,isLoad:0,page:page,size:15,param:{menuid:menuid}},function(data){
				da = data.list;
				Jes.each(da,function(i){
					html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
					html.push('<td><a class=font14_666666 title="'+da[i].title+'" href="'+Jes.sysUrl('infoshow',{menuid:da[i].fmenuid,infoid:da[i].id})+'" target=_blank>'+da[i].title.sub(60,1)+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
					html.push('<td align="rigth" width="100"><FONT color=gray>('+da[i].posttime.sub(10)+')</FONT></SPAN></td></tr><tr background="../themes/default/images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
				});
				html.push('</tbody></table>');
				Jes.html('info_list',html);
				var _pageH = Jes.pageH(data,'Jes.Info.infoPage(\''+menuid+'\','+type+',page);');
				Jes.html('page_div',_pageH);
			});
		}else if(type=='2'){
			/*
			Jes.page('lead_query_sql@bl',{isSess:0,isLoad:0,page:page,size:15,param:{menuid:menuid}},function(data){
				da = data.list;
				Jes.each(da,function(i){
					html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
					html.push('<td><a class=font14_666666 title="'+da[i].name+'" href="'+Jes.sysUrl('lead',{menuid:menuid,infoid:da[i].id})+'" target=_blank>'+da[i].name.sub(60,1)+'</a>&nbsp;</td>');//<FONT color=#ff9900>(图)</FONT>
					html.push('<td align="rigth" width="100"><FONT color=gray>('+Jes.tsfNull(da[i].posttime,'').sub(10)+')</FONT></SPAN></td></tr><tr background="../themes/default/images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
				});
				html.push('</tbody></table>');
				Jes.html('info_list',html);
				var _pageH = Jes.pageH(data,'Jes.Info.infoPage(\''+menuid+'\','+type+',page);');
				Jes.html('page_div',_pageH);
			});
			*/
		}
	}
	,infoUploadPage : function(menuid,page){
		var html =['<table border=0 cellSpacing=0 cellPadding=0 width="100%"><tbody>'];
		Jes.page('upload_menuid_query_sql@bl',{isSess:0,isLoad:0,page:page,size:15,param:{menuid:menuid}},function(data){
			da = data.list;
			Jes.each(da,function(i){
				html.push('<tr><td width="6%" align=middle><img vspace=10 src="../themes/default/images/flag1.gif"></td>');
				html.push('<td><a class=font14_666666 title="'+this.oldname+'" href="../../download.shtml?name='+this.name+'&oldName='+this.oldname+'&dir='+this.dir+'">'+da[i].oldname+'</a>&nbsp;');//<FONT color=#ff9900>(图)</FONT>
				html.push('<FONT color=gray>('+this.uptime.sub(10)+')</FONT></SPAN></td></tr><tr background="../themes/default/images/line2.jpg"><td height=1 background="" colSpan=2></td></tr>');
			});
			html.push('</tbody></table>');
			Jes.html('info_list',html);
			var _pageH = Jes.pageH(data,'Jes.Info.infoUploadPage(\''+menuid+'\',page);');
			Jes.html('page_div',_pageH);
		});
	}
	,Photo : {
		init : function(){
			Jes.Info.menuDir(12);
			Jes.Info.left(12);
			this.infoPage();
		}
		,infoPage : function(page){
			DWRUtil.removeAllRows('ta_photo');
			Jes.page('topic_query_sql@bl',{isSess:0,isLoad:0,page:page,size:12,param:{menuid:12}},function(data){
				da = data.list;
				var taEl=Jes('ta_photo'),tr,td;
				Jes.each(da,function(i){
					if(i%3==0) tr = Jes.Table.newTr(taEl);
					td = Jes.Table.newTd(tr,null,null,'<table border="0" align="center" cellpadding="5" cellspacing="0" class="table_B7DBFF">'
					+'<tr><td align="center"><a href="'+Jes.sysUrl('infoshow',{menuid:da[i].fmenuid,infoid:da[i].id})+'" target="_blank"><img src="'+DA.imgpath+da[i].img+'" width="190" height="135" border="0"/></a></td></tr>'
					+'<tr><td align="center"><a href="'+Jes.sysUrl('infoshow',{menuid:da[i].fmenuid,infoid:da[i].id})+'" target="_blank" title="'+da[i].title+'">'+da[i].title.sub(60,1)+'</a></td></tr></table>');
				});
				var _pageH = Jes.pageH(data,'Jes.Info.Photo.infoPage(page);');
				Jes.html('page_div',_pageH);
			});
		}
	}
}

Jes.InfoShow = {
	init : function(){
		var req = Jes.request();
		if(req) this.show(req.menuid,req.infoid);
	}
	,show : function(menuid,infoid){
		Jes.Info.left(menuid);
		Jes.queryO('TJesFmenu',{isLoad:false,isSess:0,param:{id:menuid}},function(da){
			Jes.html('fmenu','<a href="center.html">首页</a> &gt;&gt; <a class="fontRedBold" href="info.html?menuid='+da.id+'">'+da.name+'</a>');
		});
		Jes.sql({isSess:0,isLoad:false,ids:infoid,sql:'topic_clicks_update_hql@bs'},function(da){
			Jes.queryO('topic_obj_query_sql@bl',{isLoad:0,isSess:0,param:{id:infoid}},function(da){
				Jes.html('posttime','发布日期：'+da.posttime.sub(10));
				var title = da.title,keywards=da.keywards||'';
				if(da.tcss){
					title = '<span style="'+da.tcss+'">'+title+'</span>'
				}else{
					title = da.tcolor?'<font color="'+da.tcolor+'">'+da.title+'</font>':da.title;
				}
				if(da.subtitle){
					title += '</br><font size=3>'+da.subtitle+'</font>';
				}
				var cont = '<div style="'+da.ccss+'">'+da.content+'</div>'
				//Jes.vals({'maintitle':title,'username':'作者：'+da.username,'clicks':'阅读次数：'+da.clicks,'deptname':'来源：'+da.deptname,'content':cont});//Jes.vals(da);
				Jes.vals({'maintitle':title,'clicks':'阅读次数：'+da.clicks,'content':cont});//Jes.vals(da);
                if(da.username) Jes.val('username','作者：'+da.username);
                if(da.deptname) Jes.val('deptname','来源：'+da.deptname);
				if(da.vurl){
					Jes.val('vurl','<object type="application/x-shockwave-flash" data="vcastr3.swf" width="440" height="360" id="vcastr3">'
                	+'<param name="movie" value="vcastr3.swf"/><param name="allowFullScreen" value="true" />'
                	+'<param name="FlashVars" value="xml=<vcastr><channel><item><source>'+da.vurl+'</source><duration></duration><title></title></item></channel><config><isShowAbout>true</isShowAbout><isAutoPlay>false</isAutoPlay></config></vcastr>"/></object>');
					/*
					Jes.val('vurl','<object id="wmplay" width="440" height="360" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
					+'<param name="FileName" value="'+da.vurl+'"><param name="DisplaySize" value="0"><param name="autostart" value="0">'
					+'<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin" filename="'+da.vurl+'" displaysize="0" name="wmplay" width="440" height="360"></embed></object>');
					//Jes.val('vurl','<embed src="'+da.vurl+'" width="440" height="360" autostart="false"></embed>');
					*/
				}
				//相关要闻
				//这个优化成query
				/*
				Jes.page('topic_query_sql@bl',{param:{'keytype':'1','keyval':keywards},isSess:0,isLoad:0,size:5},function(_da){
					_da=_da.list;
					var taEl=Jes('xgyw'),tr,td;
					Jes.each(_da,function(i){
						tr = Jes.Table.newTr(taEl);
						td = Jes.Table.newTd(tr,{'height':'25','align':'left'},null,'&nbsp;<img src="../themes/default/images/flag5.gif" hspace="10"><A href="'+Jes.sysUrl('infoshow',{menuid:this.fmenuid,infoid:this.id})+'" title="'+this.title+'">'+this.title+'</A><font  class="fontCCCCCC">['+this.posttime.sub(10)+']</font>');
					});
				});
				*/
			});
		});
		Jes.Upload.query({param:{bussid:infoid,busstype:1},isLoad:0,isSess:0},function(da){
			if(!Jes.isNull(da)){
				var html =['附件下载:<br/>']
				Jes.each(da,function(i){
					html.push('<a href="../../download.shtml?name='+da[i].name+'&oldName='+da[i].oldname+'&dir='+da[i].dir+'">'+da[i].oldname+'</a><br>');
				});
				Jes.html('upload',html);
			}
		});
	}
	,searchInit : function(){
		//this.left();
		var req = Jes.request();
		if(req.type=='2'){
			Jes.val('sTitle','高 级 检 索');
			Jes.show('s2','s3');
		}
		Jes.vals(req);
		Jes.action('getFmenuTree@App',{type:'checkbox',all:'1',only:'1',upD:'2',role:'0'},function(data){
			Jes.html('fmenu_tree',data);
			treeObj = new JSDragDropTree();
			//treeObj.setImageFolder('../../components/drag-drop-folder-tree/images/');//设置图片路径
			treeObj.setTreeId('dhtml_tree');
			treeObj.setMaximumDepth(10);
			treeObj.setMessageMaximumDepthReached('超过最多级别'); // If you want to show a message when maximum depth is reached, i.e. on drop.
			treeObj.initTree();
			treeObj.expand();
			//treeObj.expandAll();
			//Jes.html('fmenu_tree',dwr.util.escapeHtml(Jes.html('fmenu_tree')));
		});
		if(Jes('keyval').value!='') this.search();
	}
	,search : function(){
		Jes.page('topic_query_sql@bl',{isSess:0,size:20});
	}
	,tsfSearch : function(infoid,title,menuid,menuname,posttime){
		return '<img src="../themes/default/images/flag7.jpg" width="9" height="9">&nbsp;&nbsp;&nbsp;<a title="'+title+'" href="index.html?act=infoshow&menuid='+menuid+'&infoid='+infoid+'" target="_blank">'+title+'</a><font color="gray">('+posttime.substr(0,19)+')</font>&nbsp;'
			+'<a href="javascript:top.Jes.iframe(\'info.html?menuid='+menuid+'\');"><font color=gray>'+menuname+'</font></a>';
	}
	//显示栏目
	,menu : function(){
		Jes.FlyDiv.show("mdiv",null,null);
	}
	,selMenu : function(){
		//显示栏目名称
		var cks= Jes.name('tree.fmenuid'),el,name='',id='';
		Jes.each(cks,function(i){
			el = cks[i];
			if(el.checked){
				id+=(name==''?'':',')+"'"+el.value+"'";
				name+=(name==''?'':' ')+'<span style="background-color:#8ce3be;padding:5px;color:#fff">'+el.nodename+'</span>';
			}
		});
		Jes.vals({'menu':name,'menuids':id});
		Jes.FlyDiv.hide();
	}
	//ask
	,saveAsk : function(){
		Jes.save('TJesAsk',{isSess:0},function(da){
			//Jes('reset').click();
			top.Jes.top();
			Jes.hide('ask_ta');
			Jes.show('info_ta');
			Jes.vals(da,'info')
			//Jes.disBtn();
			//Jes.html('info','你的建议或投诉信息提交成功! 请牢记以下信息，谢谢！<br> 此次受理号码是：'+da.no+'；您的查询密码是:'+da.pwd+' <br>您可在“受理情况”中输入以上信息，查询该事件的受理状态和结果。');
		});
	}
	,askInit : function(){
		Jes.Info.left();
		Jes.sync(function(){
			Jes.Select.ask(false);
		});
		var type = Jes.request('type');
		Jes.vals({'type':type,'ask_title1':DA.ASK[type],'ask_title2':DA.ASK[type]});
		if(type == null){
			Jes.show('tr_1','t_1','t_2');
			Jes('t_4').removeAttribute('colSpan');
		}
		if(type=='1'){
			Jes.show('tr_1');
			Jes.name('ispub')[0].checked='true';
		}
		Jes('sl').href='asklist.html?type='+type;
	}
	,askListInit : function(){
		Jes.Info.left();
		/*
		Jes.sync(function(){
			Jes.Select.ask();
		});
		*/
		var type = Jes.request('type');
		Jes.hide('type_1','type_2','type_4');
		Jes.show('type_'+type,'s_'+type);
		Jes.vals({'type':type,'ask_title':DA.ASK[type]});
		Jes('xx').href='ask.html?type='+type;
		this.queryAsk();
	}
	,queryAsk : function(page){
		if(Jes('no').value!='' && Jes('pwd').value==''){
			alert('请输入密码!');
			return;
		}
		Jes.html('ask_list','<center><img src="../themes/default/images/load2.gif"/></center>');
		Jes.page('ask_query_sql@bl',{isSess:0,isLoad:0,page:page,size:10},function(da){
			var _pageH = Jes.pageH(da,'Jes.InfoShow.queryAsk(page)');//对象和方法
			Jes.html('page_top1',_pageH);
			Jes.html('page_btm1',_pageH);
			da = da.list;
			var html =[];
			Jes.each(da,function(i){
				html.push('<table width="100%" cellspacing="1" cellpadding="1" bgcolor="#000000" align="center">');
				html.push('<tr><td width="120" rowspan="2" align="center" bgcolor="f0f6fd"><font color="#000000">姓名：'+this.name+'</font></td>');
				html.push('<td valign="top" style="word-break:break-all;line-height:200%;" bgcolor="f0f6fd">'+Jes.tsfStr(this.content)+'</td></tr>');
				html.push('<tr bgcolor="b2c2d7"><td align="right" bgcolor="f0f6fd">发表于:'+this.createtime.sub(19)+'&nbsp;&nbsp;&nbsp; '+(this.retime?'回复于 '+Jes.tsfNull(this.retime).sub(19):'')+'&nbsp;&nbsp;&nbsp;</td></tr>');
				html.push('<tr><td valign="top" bgcolor="f0f6fd" align="center"><font color="#FF0000">【<font color="#150487">网管回复<font color="#FF0000">】<br><img border="0" src="../themes/default/images/webmaster.gif"><br>webmaster</font></font></font></td>');
				html.push('<td bgcolor="f0f6fd"><p><font color="#150487"><b>'+Jes.tsfNull(Jes.tsfStr(this.reply),'暂时未回复'));
				if(!Jes.isNull(this.extList)){
					html.push('<br>附件:<br>')
					Jes.each(this.extList,function(j){
						html.push('<a href="../../download.shtml?name='+this.name+'&oldName='+this.oldname+'&dir='+this.dir+'">'+this.oldname+'</a></br>');
					});
				}
				html.push('</b></font></p></td></tr></table><br>');
				/*
				html.push('<br><table width="95%" border="0" align="center" cellspacing="1" cellpadding="2" bgcolor="#E2EEFE">');
					html.push('<tr><td width="13%" align="center" valign="top" bgcolor="f0f6fd"><span class="font_666666">'+this.name+'</span></td>');
						html.push('<td width="87%" bgcolor="f0f6fd">');
							html.push('<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">');
							html.push('<tr><td class="font_666666">'+this.title+'</td><td width="30%" class="font_666666">'+this.createtime.sub(19)+'</td></tr>');
							html.push('<tr><td colspan="2" height="2" bgcolor="#FFFFFF"></td></tr>');
							html.push('<tr><td colspan="2" class="font_666666">'+Jes.tsfStr(this.content)+'</td></tr>');
							html.push('</table>');
						html.push('</td></tr><tr>');
						html.push('<td align="center" bgcolor="f0f6fd"><img border="0" src="http://www.yzciq.gov.cn/images/webmaster.gif"/></td>');
						html.push('<td bgcolor="f0f6fd" class="font_666666"><p>'+Jes.tsfNull(Jes.tsfStr(this.reply),'暂时未回复'));
						if(!Jes.isNull(this.extList)){
							html.push('<br>附件:<br>')
							Jes.each(this.extList,function(j){
								html.push('<a href="../../download.shtml?name='+this.name+'&oldName='+this.oldname+'&dir='+this.dir+'">'+this.oldname+'</a></br>');
							});
						}
						html.push('<div align="right"><span class="font12_666666">'+(this.retime?'回复于 '+Jes.tsfNull(this.retime).sub(19):'')+'</span></div></p></td>');
					html.push('</tr></table>');
					*/
			});
			Jes.html('ask_list',html);
		});
	}
	,queryAskMore : function(id){
		//var param = Jes.vals(['id','pwd']);
		Jes.queryO("TJesAsk",{param:{id:id}},function(da){
			//if(da.pwd==param.pwd){
				Jes.html('askmore','Q:'+da.content+'<br>A：'+Jes.tsfNull(da.reply,'还未回复'));
			//}else{
			//	Jes.html('askmore','<font color="red">密码错误！</font>');
			//}
		});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "ask":
					Jes.val('askmore','');
					Jes.FlyDiv.show("rediv",null,null,300,300);
					Jes.InfoShow.queryAskMore(id);
				break;
		}
	}
}

Jes.Vote={
	init : function(){
		/*
		以后考虑这样的方式
		var fns={col3:function(){
		}}
		*/
		Jes.page("vote_query_sql@bs",{isLoad:0,isSess:0,pageSize:10,param:{status:'1'}});
		Jes.Info.left();
	}
	,tsfCol : function(id,begtime,endtime){
		var html='';
		var now =Jes.now();
		var btime = Jes.strToDate(begtime);
		var etime = Jes.strToDate(endtime);
		if(now>btime && (now<etime || etime=='')){
			html='<a href="index.html?act=pollnow&id='+id+'" target="_blank">进入调查</a> ';
		}
		html +='<a href="index.html?act=pollshow&id='+id+'" target="_blank">查看结果</a>';
		return html;
	}
	,nowInit : function(){
		var id = Jes.request('id'),taEl='pollnow',tr,td,html,type;
		if(id){
			Jes('ret').href='pollshow.html?id='+id;
			Jes.queryO('TJesVote',{isSess:0,param:{id:id}},function(da){
				if(da.status!='1') Jes.hide('add');
				Jes.val('id',da.id);
				tr = Jes.Table.newTr(taEl);
				Jes.Table.newTd(tr,{className:'fontBlackBold2',height:'40',align:'center'},{},da.subject);
				tr = Jes.Table.newTr(taEl);
				Jes.Table.newTd(tr,{className:'fontBlackBold',height:'40',align:'left'},{},da.content);
				tr = Jes.Table.newTr(taEl);
				Jes.Table.newTd(tr,{className:'More_FE5E00',height:'40',align:'center'},{},'开始时间'+Jes.formatDate(da.begtime,'1')+' 结束时间'+Jes.formatDate(da.endtime,'1'));
				//
				Jes.query('voteitemgroupitem_query_sql@bs',{isSess:0,param:{voteid:id}},function(da){
					id='';
					Jes.each(da,function(i){
						type = this.type;
						if(id != this.id){
							tr = Jes.Table.newTr(taEl);
							Jes.Table.newTd(tr,{className:'font14_666666',height:'30'},{},'·'+this.title+(type=='1'?'':type=='20'?'':'【可多选】'));//【简答题】
							id=this.id;
						}
						if(type=='1') html='<input type="radio" title="'+this.title+'" class="checkbox" id="'+id+'_'+type+'" name="'+id+'_'+type+'" value="'+this.itemid+'" rule="group"/>'+'·'+this.itemname;
						else if(type=='2')  html='<input type="checkbox" title="'+this.title+'" class="checkbox" id="'+id+'_'+type+'" name="'+id+'_'+type+'" value="'+this.itemid+'" rule="group"/>'+'·'+this.itemname;
						else html='<textarea style="width:400px;height:80px;" title="'+this.title+'" id="'+id+'_'+type+'" name="'+id+'_'+type+'" ></textarea>';//notnull
						tr = Jes.Table.newTr(taEl);
						//Jes.Table.newTd(tr,{width:'5px'},{},' ');
						Jes.Table.newTd(tr,{className:'font14_666666',height:'30'},{},'&nbsp;&nbsp;&nbsp;&nbsp;'+html);
					});
				});
			});
		}
		Jes.Info.left();
	}
	,saveRet : function(){
		var cS=Jes.tag('textarea');
		Jes.each(cS,function(i){
			if(this.value=='') this.value='无';
		});
		Jes.save('TJesVoteRet',{isSess:0},function(da){
			alert('感谢您参与投票!');
			Jes('ret').click();
		});
	}
	//投票结果显示
	,retInit : function(){
		var id = Jes.request('id');
		if(id){
			Jes.queryO('TJesVote',{isLoad:0,isSess:0,param:{id:id}},function(da){
				Jes.vals(da);
				Jes.vals({'begtime':Jes.formatDate(da.begtime,'1'),'endtime':Jes.formatDate(da.endtime,'1')});
			});
			Jes.query('voteret_query_sql@bs',{isSess:0,param:{voteid:id}},function(da){
				var taEl='poll_ret',tr,td,html=[],id='',item={},type;
				Jes.each(da,function(i){
					type = this.type;
					if(id != this.itemid){
						if(html!=[]){
							html.push('</table>');
							tr=Jes.Table.newTr(taEl);
							td=Jes.Table.newTd(tr,{align:'center'},null,html);
						}
						tr=Jes.Table.newTr(taEl);
						td=Jes.Table.newTd(tr,{className:'font14_666666',height:'40'},null,'·'+this.title+''+(type=='1'?'(单选题)':(type=='2'?'(多选题)':'')));
						id=this.itemid;
						html=['<table border="1" cellspacing="0" cellpadding="3" width="95%" align="center">'];
						if(type=='20'){
							//html.push('<tr height="40"><td align="middle">选项</td><td width="30%" align="middle">图形显示</td><td width="15%" align="middle">百分比(%)</td><td width="8%" align="middle">票数</td></tr>');
						}else{
							html.push('<tr height="40"><td align="middle">选项</td><td width="30%" align="middle">图形显示</td><td width="15%" align="middle">百分比(%)</td><td width="8%" align="middle">票数</td></tr>');
						}
					}
					if(item[this.itemid]) item[this.itemid] +=parseInt(Jes.tsfNull(this.num,0));
					else item[this.itemid] =parseInt(Jes.tsfNull(this.num,0));
					if(type=='20'){
						html.push('<tr><td align="right" class="font_666666" colspan="4"><a href="javascript:Jes.open(\'../../jesbs/html/voteret_content.html?itemid='+this.itemid+'\',\'600\',\'400\',\'M\');">查看</a>('+Jes.tsfNull(this.num,0)+')</td></tr>');//简答题答案
					}else{
						html.push('<tr height="25"><td class="font_666666" align="left">'+this.itemname+'</td><td class="font_666666" align="left"><img height="11px" id="votebar" name="votebar" num="'+Jes.tsfNull(this.num,0)+'" itemid="'+id+'" border="0" src="../themes/default/images/poll.gif"></td><td class="font_666666" align="middle" id="votepre" name="votepre"></td><td class="font_666666" align="middle">'+Jes.tsfNull(this.num,0)+'</td></tr>');
					}
				});
				if(html!=[]){
					html.push('</table>');
					tr=Jes.Table.newTr(taEl);
					td=Jes.Table.newTd(tr,{align:'center'},null,html);
				}
				Jes.html('item',html);
				var imgs = Jes.name('votebar'),pres=Jes.name('votepre');
				Jes.each(imgs,function(i){
					this.width= (this.num*190/item[this.itemid]);
					if(item[this.itemid]==0) Jes.html(pres[i],'0%');
					else Jes.html(pres[i],(this.num*100/item[this.itemid]+'').substr(0,4)+'%');
				});
			});
		}
		Jes.Info.left();
	}
}

Jes.Lead ={
	init : function(){
		var req= Jes.request();
		Jes.Info.left(req.menuid);
		Jes.queryO('TJesFmenu',{isLoad:0,isSess:0,param:{id:req.menuid}},function(da){
			Jes.html('fmenu','<a href="center.html">首页</a>&gt;<a class="fontRedBold" href="info.html?menuid='+da.id+'">'+da.name+'</a>');
		});
		Jes.queryO('TJesLead',{isLoad:0,isSess:0,param:{id:req.infoid}},function(da){
			Jes.html('_img','<img src="'+DA.imgpath+da.img+'" hspace="20" vspace="10">');
			//<img src="/nbciq/site/attach/2010/2010060104200710.gif" width="139" height="199" hspace="20" vspace="10">
			Jes.vals(da);
		});
	}
}

function doZoom(size) {
	Jes('zoom').style.fontSize = size + 'px';
}